//
// Created by Joey on 2019/12/14.
//
#include<iostream>
#include <math.h>

using namespace std;


int main() {
    int start = 100;
    int g;
    int s;
    int b;

    do {
        g = start % 10;
        s = start / 10 % 10;
        b = start / 100;
        // cout << start << endl;
        //cout << b << " " << s << " " << g << endl;
        int res = pow(g, 3) + pow(s, 3) + pow(b, 3);
        if (res == start)
            cout << res << endl;

        start += 1;
    } while (start < 999);

}
